package com.miku.blog.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.miku.blog.domain.WebsiteRes;
import com.miku.blog.domain.pojo.SystemConstance;
import com.miku.blog.service.WebsiteResService;
import com.miku.blog.mapper.WebsiteResMapper;
import org.springframework.stereotype.Service;

/**
* @author Miku
* @description 针对表【tb_website_res】的数据库操作Service实现
* @createDate 2022-06-08 08:47:10
*/
@Service
public class WebsiteResServiceImpl extends ServiceImpl<WebsiteResMapper, WebsiteRes>
    implements WebsiteResService{



    @Override
    public WebsiteRes getWebSiteRes(Integer webSiteId){
        LambdaQueryWrapper<WebsiteRes> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(WebsiteRes::getWebsiteId,webSiteId);
        return getOne(queryWrapper);
    }

    @Override
    public boolean updateWebsiteRes(WebsiteRes websiteRes) {
        LambdaUpdateWrapper<WebsiteRes> updateWrapper = new LambdaUpdateWrapper<>();
        updateWrapper.eq(WebsiteRes::getWebsiteId, SystemConstance.WEBSITE_ID);
        return update(websiteRes,updateWrapper);
    }
}




